import Mock from 'mockjs2'
import { builder } from '../util'

const info = (options) => {
  const userInfo = {
    id: '4291d7da9005377ec9aec4a71ea837f',
    name: '天野远子',
    username: 'admin',
    password: '',
    avatar: '/avatar2.jpg',
    status: 1,
    telephone: '',
    lastLoginIp: '27.154.74.117',
    lastLoginTime: 1534837621348,
    creatorId: 'admin',
    createTime: 1497160610259,
    merchantCode: 'TLif2btpzg079h15bk',
    deleted: 0,
    roleId: 'admin',
    role: {},
  }
  // role
  const roleObj = {
    id: 'admin',
    name: '管理员',
    describe: '拥有所有权限',
    status: 1,
    creatorId: 'system',
    createTime: 1497160610259,
    deleted: 0,
    permissions: [
      {
        roleId: 'admin',
        permissionId: 'dashboard',
        permissionName: '仪表盘',
        // actions:
        //   '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]',
        actionEntitySet: [
          {
            action: 'add',
            describe: '新增',
            defaultCheck: false,
          },
          {
            action: 'query',
            describe: '查询',
            defaultCheck: false,
          },
          {
            action: 'get',
            describe: '详情',
            defaultCheck: false,
          },
          {
            action: 'update',
            describe: '修改',
            defaultCheck: false,
          },
          {
            action: 'delete',
            describe: '删除',
            defaultCheck: false,
          },
        ],
        actionList: null,
        dataAccess: null,
      },
      {
        roleId: 'admin',
        permissionId: 'exception',
        permissionName: '异常页面权限',
        // actions:
        //   '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]',
        actionEntitySet: [
          {
            action: 'add',
            describe: '新增',
            defaultCheck: false,
          },
          {
            action: 'query',
            describe: '查询',
            defaultCheck: false,
          },
          {
            action: 'get',
            describe: '详情',
            defaultCheck: false,
          },
          {
            action: 'update',
            describe: '修改',
            defaultCheck: false,
          },
          {
            action: 'delete',
            describe: '删除',
            defaultCheck: false,
          },
        ],
        actionList: null,
        dataAccess: null,
      },
      {
        roleId: 'admin',
        permissionId: 'result',
        permissionName: '结果权限',
        // actions:
        //   '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]',
        actionEntitySet: [
          {
            action: 'add',
            describe: '新增',
            defaultCheck: false,
          },
          {
            action: 'query',
            describe: '查询',
            defaultCheck: false,
          },
          {
            action: 'get',
            describe: '详情',
            defaultCheck: false,
          },
          {
            action: 'update',
            describe: '修改',
            defaultCheck: false,
          },
          {
            action: 'delete',
            describe: '删除',
            defaultCheck: false,
          },
        ],
        actionList: null,
        dataAccess: null,
      },
      {
        roleId: 'admin',
        permissionId: 'profile',
        permissionName: '详细页权限',
        // actions:
        //   '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]',
        actionEntitySet: [
          {
            action: 'add',
            describe: '新增',
            defaultCheck: false,
          },
          {
            action: 'query',
            describe: '查询',
            defaultCheck: false,
          },
          {
            action: 'get',
            describe: '详情',
            defaultCheck: false,
          },
          {
            action: 'update',
            describe: '修改',
            defaultCheck: false,
          },
          {
            action: 'delete',
            describe: '删除',
            defaultCheck: false,
          },
        ],
        actionList: null,
        dataAccess: null,
      },
      {
        roleId: 'admin',
        permissionId: 'table',
        permissionName: '表格权限',
        // actions:
        //   '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"import","defaultCheck":false,"describe":"导入"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"}]',
        actionEntitySet: [
          {
            action: 'add',
            describe: '新增',
            defaultCheck: false,
          },
          {
            action: 'import',
            describe: '导入',
            defaultCheck: false,
          },
          {
            action: 'get',
            describe: '详情',
            defaultCheck: false,
          },
          {
            action: 'update',
            describe: '修改',
            defaultCheck: false,
          },
        ],
        actionList: null,
        dataAccess: null,
      },
      {
        roleId: 'admin',
        permissionId: 'form',
        permissionName: '表单权限',
        // actions:
        //   '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]',
        actionEntitySet: [
          {
            action: 'add',
            describe: '新增',
            defaultCheck: false,
          },
          {
            action: 'get',
            describe: '详情',
            defaultCheck: false,
          },
          {
            action: 'query',
            describe: '查询',
            defaultCheck: false,
          },
          {
            action: 'update',
            describe: '修改',
            defaultCheck: false,
          },
          {
            action: 'delete',
            describe: '删除',
            defaultCheck: false,
          },
        ],
        actionList: null,
        dataAccess: null,
      },
      {
        roleId: 'admin',
        permissionId: 'order',
        permissionName: '订单管理',
        // actions:
        //   '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]',
        actionEntitySet: [
          {
            action: 'add',
            describe: '新增',
            defaultCheck: false,
          },
          {
            action: 'query',
            describe: '查询',
            defaultCheck: false,
          },
          {
            action: 'get',
            describe: '详情',
            defaultCheck: false,
          },
          {
            action: 'update',
            describe: '修改',
            defaultCheck: false,
          },
          {
            action: 'delete',
            describe: '删除',
            defaultCheck: false,
          },
        ],
        actionList: null,
        dataAccess: null,
      },
      {
        roleId: 'admin',
        permissionId: 'permission',
        permissionName: '权限管理',
        // actions:
        //   '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]',
        actionEntitySet: [
          {
            action: 'add',
            describe: '新增',
            defaultCheck: false,
          },
          {
            action: 'get',
            describe: '详情',
            defaultCheck: false,
          },
          {
            action: 'update',
            describe: '修改',
            defaultCheck: false,
          },
          {
            action: 'delete',
            describe: '删除',
            defaultCheck: false,
          },
        ],
        actionList: null,
        dataAccess: null,
      },
      {
        roleId: 'admin',
        permissionId: 'role',
        permissionName: '角色管理',
        // actions:
        //   '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]',
        actionEntitySet: [
          {
            action: 'add',
            describe: '新增',
            defaultCheck: false,
          },
          {
            action: 'get',
            describe: '详情',
            defaultCheck: false,
          },
          {
            action: 'update',
            describe: '修改',
            defaultCheck: false,
          },
          {
            action: 'delete',
            describe: '删除',
            defaultCheck: false,
          },
        ],
        actionList: null,
        dataAccess: null,
      },
      {
        roleId: 'admin',
        permissionId: 'table',
        permissionName: '桌子管理',
        // actions:
        //   '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"query","defaultCheck":false,"describe":"查询"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"}]',
        actionEntitySet: [
          {
            action: 'add',
            describe: '新增',
            defaultCheck: false,
          },
          {
            action: 'get',
            describe: '详情',
            defaultCheck: false,
          },
          {
            action: 'query',
            describe: '查询',
            defaultCheck: false,
          },
          {
            action: 'update',
            describe: '修改',
            defaultCheck: false,
          },
          {
            action: 'delete',
            describe: '删除',
            defaultCheck: false,
          },
        ],
        actionList: null,
        dataAccess: null,
      },
      {
        roleId: 'admin',
        permissionId: 'user',
        permissionName: '用户管理',
        // actions:
        //   '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"import","defaultCheck":false,"describe":"导入"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"},{"action":"export","defaultCheck":false,"describe":"导出"}]',
        actionEntitySet: [
          {
            action: 'add',
            describe: '新增',
            defaultCheck: false,
          },
          {
            action: 'import',
            describe: '导入',
            defaultCheck: false,
          },
          {
            action: 'get',
            describe: '详情',
            defaultCheck: false,
          },
          {
            action: 'update',
            describe: '修改',
            defaultCheck: false,
          },
          {
            action: 'delete',
            describe: '删除',
            defaultCheck: false,
          },
          {
            action: 'export',
            describe: '导出',
            defaultCheck: false,
          },
        ],
        actionList: null,
        dataAccess: null,
      },
    ],
  }

  // roleObj.permissions.push({
  //   roleId: 'admin',
  //   permissionId: 'support',
  //   permissionName: '超级模块',
  //   actions:
  //     '[{"action":"add","defaultCheck":false,"describe":"新增"},{"action":"import","defaultCheck":false,"describe":"导入"},{"action":"get","defaultCheck":false,"describe":"详情"},{"action":"update","defaultCheck":false,"describe":"修改"},{"action":"delete","defaultCheck":false,"describe":"删除"},{"action":"export","defaultCheck":false,"describe":"导出"}]',
  //   actionEntitySet: [
  //     {
  //       action: 'add',
  //       describe: '新增',
  //       defaultCheck: false
  //     },
  //     {
  //       action: 'import',
  //       describe: '导入',
  //       defaultCheck: false
  //     },
  //     {
  //       action: 'get',
  //       describe: '详情',
  //       defaultCheck: false
  //     },
  //     {
  //       action: 'update',
  //       describe: '修改',
  //       defaultCheck: false
  //     },
  //     {
  //       action: 'delete',
  //       describe: '删除',
  //       defaultCheck: false
  //     },
  //     {
  //       action: 'export',
  //       describe: '导出',
  //       defaultCheck: false
  //     }
  //   ],
  //   actionList: null,
  //   dataAccess: null
  // })

  userInfo.role = roleObj
  return builder(userInfo)
}

/**
 * 使用 用户登录的 token 获取用户有权限的菜单
 * 返回结构必须按照这个结构体形式处理，或根据
 * /src/router/generator-routers.js  文件的菜单结构处理函数对应即可
 * @param {*} options
 * @returns
 */
const userNav = (options) => {
  const nav = [
    // dashboard
    {
      name: 'dashboard',
      parentId: 0,
      id: 1000,
      meta: {
        icon: 'dashboard',
        title: '工作界面',
        show: true,
      },
      component: 'RouteView',
      redirect: '/dashboard/workplace',
    },
    {
      name: 'workplace',
      parentId: 1000,
      id: 10001,
      meta: {
        title: '工作台',
        show: true,
      },
      component: 'dashboard/Workplace',
    },
    {
      name: 'dataBulletinBoard',
      parentId: 1000,
      id: 10002,
      meta: {
        title: '数据看板',
        show: true,
      },
      component: 'dashboard/dataBulletinBoard',
    },

    // 社区
    {
      name: 'CommunityReviewManagement',
      parentId: 0,
      id: 1001,
      meta: {
        icon: 'regulatory-reporting',
        title: '社区审核管理',
        show: true,
      },
      component: 'RouteView',
      redirect: '/CommunityReviewManagement/primaryAuditManagement',
    },
    {
      name: 'applicationForm',
      parentId: 1001,
      id: 10011,
      meta: {
        title: '申请表填写',
      },
      component: 'CommunityReviewManagement/applicationForm',
    },
    {
      name: 'editApplicationForm',
      parentId: 1001,
      id: 10012,
      meta: {
        title: '申请表修改',
        show: false,
      },
      path: '/CommunityReviewManagement/applicationForm/:id',
      component: 'CommunityReviewManagement/applicationForm',
    },
    {
      name: 'primaryAuditManagement',
      parentId: 1001,
      id: 10013,
      meta: {
        title: '社区审核管理',
      },
      component: 'CommunityReviewManagement/primaryAuditManagement',
    },
    {
      name: 'changeDeclare',
      parentId: 1001,
      id: 10014,
      meta: {
        title: '异动申报',
      },
      component: 'CommunityReviewManagement/changeDeclare',
    },
    {
      name: 'changeResult',
      parentId: 1001,
      id: 10015,
      meta: {
        title: '异动结果查询',
      },
      component: 'CommunityReviewManagement/changeResult',
    },
    {
      name: 'complexInquire',
      parentId: 1001,
      id: 10016,
      meta: {
        title: '社区综合查询',
      },
      component: 'CommunityReviewManagement/complexInquire',
    },
    {
      name: 'modificationPhone',
      parentId: 1001,
      id: 10016,
      meta: {
        title: '电话号码修改',
      },
      component: 'CommunityReviewManagement/modificationPhone',
    },
    {
      name: 'netDeclareReceive',
      parentId: 1001,
      id: 10017,
      meta: {
        title: '网申数据接入',
      },
      component: 'CommunityReviewManagement/netDeclareReceive',
    },

    // 公用界面
    {
      name: 'common',
      parentId: 0,
      id: 1003,
      meta: {
        title: '住房保障',
        show: false,
      },
      component: 'RouteView',
      redirect: '/dashboard/workplace',
    },
    {
      name: 'assureInformationView',
      parentId: 1003,
      id: 10031,
      meta: {
        title: '保障用户信息查看',
        show: false,
      },
      path: '/assureInformationView/:id',
      component: 'commonViews/detail',
    },
    {
      name: 'assureInformationAudit',
      parentId: 1003,
      id: 10032,
      meta: {
        title: '审核',
        show: false,
      },
      path: '/assureInformationAudit/:id',
      component: 'commonViews/audit',
    },
    {
      name: 'assureInformationEdit',
      parentId: 1003,
      id: 10033,
      meta: {
        title: '保障用户信息修改',
        show: false,
      },
      path: '/assureInformationEdit/:id',
      component: 'commonViews/edit',
    },

    // 后续管理
    {
      name: 'followUpManagement',
      parentId: 0,
      id: 1004,
      meta: {
        title: '后续管理',
        icon: 'regulatory-reporting',
      },
      component: 'RouteView',
      redirect: '/followUpManagement/propertyManagement/projectPlan',
    },
    {
      name: 'propertyManagement',
      parentId: 1004,
      id: 10041,
      meta: {
        title: '房源管理',
      },
      component: 'BlankLayout',
      redirect: '/followUpManagement/propertyManagement/projectPlan',
    },
    {
      name: 'projectPlan',
      parentId: 10041,
      id: 100411,
      meta: {
        title: '项目计划',
      },
      component: 'followUpManagement/propertyManagement/projectPlan',
    },
    {
      name: 'engineeringProject',
      parentId: 10041,
      id: 100412,
      meta: {
        title: '工程项目',
      },
      component: 'followUpManagement/propertyManagement/engineeringProject',
    },
    {
      name: 'realEstateInformation',
      parentId: 10041,
      id: 100413,
      meta: {
        title: '楼盘信息',
      },
      component: 'followUpManagement/propertyManagement/realEstateInformation',
    },
    {
      name: 'engineeringProjectschedule',
      parentId: 10041,
      id: 100414,
      meta: {
        title: '项目进度',
        show: false,
      },
      path: '/followUpManagement/propertyManagement/engineeringProject/schedule/:id',
      component: 'followUpManagement/propertyManagement/engineeringProject/schedule',
    },
    {
      name: 'realEstateInformationHouse',
      parentId: 10041,
      id: 100415,
      meta: {
        title: '房源信息',
        show: false,
      },
      path: '/followUpManagement/propertyManagement/realEstateInformation/house/:id',
      component: 'followUpManagement/propertyManagement/realEstateInformation/house',
    },
    {
      name: 'peopleLedger',
      parentId: 10041,
      id: 100416,
      meta: {
        title: '人员台账(临时)',
      },
      component: 'followUpManagement/propertyManagement/peopleLedger',
    },
    {
      name: 'buildingClassificationLedger',
      parentId: 10041,
      id: 100417,
      meta: {
        title: '房源分类台账',
      },
      component: 'followUpManagement/propertyManagement/buildingClassificationLedger',
    },
    {
      name: 'buildingLedger',
      parentId: 10041,
      id: 100418,
      meta: {
        title: '房源台账',
      },
      component: 'followUpManagement/propertyManagement/buildingLedger',
    },
    {
      name: 'contractManagement',
      parentId: 1004,
      id: 10042,
      meta: {
        title: '合同管理',
      },
      component: 'BlankLayout',
      redirect: '/followUpManagement/contractManagement/contractSigin/newContract',
    },
    {
      name: 'contractSigin',
      parentId: 10042,
      id: 100421,
      meta: {
        title: '合同签订',
      },
      component: 'BlankLayout',
      redirect: '/followUpManagement/contractManagement/contractSigin/newContract',
    },
    {
      name: 'newContract',
      parentId: 100421,
      id: 1004211,
      meta: {
        title: '新签合同管理',
      },
      component: 'followUpManagement/contractManagement/contractSigin/newContract',
    },
    {
      name: 'quitReApply',
      parentId: 100421,
      id: 1004212,
      meta: {
        title: '退出占用重新申请',
      },
      component: 'followUpManagement/contractManagement/contractSigin/quitReApply',
    },
    {
      name: 'continuedContract',
      parentId: 100421,
      id: 1004213,
      meta: {
        title: '续签合同管理',
      },
      component: 'followUpManagement/contractManagement/contractSigin/continuedContract',
    },
    {
      name: 'repairContract',
      parentId: 100421,
      id: 1004213,
      meta: {
        title: '补签合同管理',
      },
      component: 'followUpManagement/contractManagement/contractSigin/repairContract',
    },
    {
      name: 'endContract',
      parentId: 100421,
      id: 1004214,
      meta: {
        title: '终止合同管理',
      },
      component: 'followUpManagement/contractManagement/contractSigin/endContract',
    },

    // 区县
    {
      name: 'DistrictReviewReportManagement',
      parentId: 0,
      id: 1005,
      meta: {
        icon: 'regulatory-reporting',
        title: '区县(市)审核申报',
      },
      component: 'RouteView',
      redirect: '/DistrictReviewReportManagement/districtAuditManagement',
    },
    {
      name: 'districtAuditManagement',
      parentId: 1005,
      id: 10051,
      meta: {
        title: '区级审核',
      },
      component: 'DistrictReviewReportManagement/districtAuditManagement',
    },
    {
      name: 'districtDataReport',
      parentId: 1005,
      id: 10052,
      meta: {
        title: '区级数据上报',
      },
      component: 'DistrictReviewReportManagement/districtDataReport',
    },
    {
      name: 'districtReportResult',
      parentId: 1005,
      id: 10053,
      meta: {
        title: '上报结果查询',
      },
      component: 'DistrictReviewReportManagement/reportResult',
    },
    {
      name: 'districtChangeDeclare',
      parentId: 1005,
      id: 10054,
      meta: {
        title: '区级异动申报',
      },
      component: 'DistrictReviewReportManagement/changeDeclare',
    },
    {
      name: 'districtDistribution',
      parentId: 1005,
      id: 10055,
      meta: {
        title: '分配管理区级',
      },
      component: 'BlankLayout',
    },
    {
      name: 'districtDistributionMaterialObject',
      parentId: 10055,
      id: 100551,
      meta: {
        title: '实物分配区级',
      },
      component: 'DistrictReviewReportManagement/distribution/materialObject',
    },

    // 市级
    {
      name: 'cityReviewAndManage',
      parentId: 0,
      id: 1006,
      meta: {
        icon: 'regulatory-reporting',
        title: '市级审核与管理平台',
      },
      component: 'RouteView',
      redirect: '/cityReviewAndManage/districtAuditManagement',
    },
    {
      name: 'districtReportReceive',
      parentId: 1006,
      id: 10061,
      meta: {
        title: '区级上报接收',
      },
      component: 'cityReviewAndManage/districtReportReceive',
    },
    {
      name: 'dataReceiveReview',
      parentId: 1006,
      id: 10062,
      meta: {
        title: '数据接收审核',
      },
      component: 'cityReviewAndManage/dataReceiveReview',
    },
    {
      name: 'cityReviewEdit',
      parentId: 1006,
      id: 10063,
      meta: {
        title: '市级审核修改',
      },
      component: 'cityReviewAndManage/cityReviewEdit',
    },
    {
      name: 'leaderNewReview',
      parentId: 1006,
      id: 10064,
      meta: {
        title: '主任审批',
      },
      component: 'cityReviewAndManage/leaderNewReview',
    },
    {
      name: 'leaderNewReviewManage',
      parentId: 1006,
      id: 10065,
      meta: {
        title: '主任审批管理',
      },
      component: 'cityReviewAndManage/leaderNewReviewManage',
    },
    // {
    //   name: 'Analysis',
    //   parentId: 1000,
    //   id: 10002,
    //   meta: {
    //     title: '分析页',
    //     show: true
    //   },
    //   component: 'dashboard/Analysis',
    //   path: '/dashboard/analysis'
    // },
    // {
    //   name: 'develop',
    //   parentId: 0,
    //   id: 1005,
    //   meta: {
    //     title: '开发管理',
    //     icon: 'tool',
    //     show: true
    //   },
    //   redirect: '/develop/parameter',
    //   component: 'RouteView'
    // },
    // {
    //   path: '/develop/parameter',
    //   name: 'parameter',
    //   parentId: 1005,
    //   id: 10051,
    //   component: 'develop/parameter',
    //   meta: {
    //     title: '参数管理',
    //     hidden: true
    //   }
    // },
    // {
    //   path: '/develop/sms',
    //   name: 'sms',
    //   parentId: 1005,
    //   id: 10052,
    //   component: 'develop/sms',
    //   meta: {
    //     title: '短信管理',
    //     hidden: true
    //   }
    // },
    // {
    //   name: 'journal',
    //   parentId: 0,
    //   id: 1006,
    //   meta: {
    //     title: '日志管理',
    //     icon: 'profile',
    //     show: true
    //   },
    //   redirect: '/journal/access',
    //   component: 'RouteView'
    // },
    // {
    //   path: '/journal/access',
    //   name: 'access',
    //   parentId: 1006,
    //   id: 10061,
    //   component: 'journal/access',
    //   meta: {
    //     title: '访问日志',
    //     show: true
    //   }
    // },
    // {
    //   path: '/journal/operation',
    //   name: 'operation',
    //   parentId: 1006,
    //   id: 10062,
    //   component: 'journal/operation',
    //   meta: {
    //     title: '操作日志',
    //     show: true
    //   }
    // },
    // Exception
    // {
    //   name: 'exception',
    //   parentId: 0,
    //   id: 1001,
    //   meta: {
    //     title: '异常页',
    //     icon: 'warning',
    //     show: true
    //   },
    //   redirect: '/exception/403',
    //   component: 'RouteView'
    // },
    // {
    //   name: '403',
    //   parentId: 1001,
    //   id: 10011,
    //   meta: {
    //     title: '403',
    //     show: true
    //   },
    //   component: 'exception/403'
    // },
    // {
    //   name: '404',
    //   parentId: 1001,
    //   id: 10012,
    //   meta: {
    //     title: '404',
    //     show: true
    //   },
    //   component: 'exception/404'
    // },
    // {
    //   name: '500',
    //   parentId: 1001,
    //   id: 10013,
    //   meta: {
    //     title: '500',
    //     show: true
    //   },
    //   component: 'exception/500'
    // },

    // System
    {
      name: 'system',
      parentId: 0,
      id: 1002,
      meta: { icon: 'setting', title: '系统管理', show: true },
      component: 'RouteView',
      redirect: '/system/user',
    },
    {
      name: 'user',
      parentId: 1002,
      id: 10021,
      meta: { title: '用户管理', show: true },
      component: 'system/user',
    },
    {
      name: 'department',
      parentId: 1002,
      id: 10022,
      meta: { title: '部门管理', show: true },
      component: 'system/department',
      path: '/system/department',
    },
    {
      name: 'role',
      parentId: 1002,
      id: 10023,
      meta: { title: '角色管理', show: true },
      component: 'system/role',
      path: '/system/role',
    },
    {
      name: 'menu',
      parentId: 1002,
      id: 10024,
      meta: { title: '菜单管理', show: true },
      component: 'system/menu',
      path: '/system/menu',
    },
    // {
    //   name: 'test',
    //   parentId: 0,
    //   id: 1003,
    //   meta: { 'icon': 'setting', 'title': '测试', 'show': true },
    //   component: 'RouteView',
    //   redirect: '/dashboard/tests'
    // },
    // {
    //   name: 'tests',
    //   parentId: 1003,
    //   id: 10031,
    //   meta: { 'title': '测试', 'show': true },
    //   component: 'dashboard/TestWork',
    //   path: '/dashboard/tests'
    // },
    // {
    //   name: 'forms',
    //   parentId: 1003,
    //   id: 10032,
    //   meta: { 'title': '表单', 'show': true },
    //   component: 'other/BigForm',
    //   path: '/other/forms'
    // },
    // {
    //   name: 'icons',
    //   parentId: 1003,
    //   id: 10033,
    //   meta: { 'title': '图标', 'show': true },
    //   component: 'other/IconSelectorView',
    //   path: '/other/icons'
    // },
    // {
    //   name: 'permissions',
    //   parentId: 1003,
    //   id: 10034,
    //   meta: { 'title': '权限', 'show': true },
    //   component: 'other/PermissionList',
    //   path: '/other/permissions'
    // },
    // {
    //   name: 'roles',
    //   parentId: 1003,
    //   id: 10035,
    //   meta: { 'title': '角色', 'show': true },
    //   component: 'other/RoleList',
    //   path: '/other/roles'
    // },
    // {
    //   name: 'tables',
    //   parentId: 1003,
    //   id: 10036,
    //   meta: { 'title': '表格', 'show': true },
    //   component: 'other/TableInnerEditList',
    //   path: '/other/tables'
    // },
    // {
    //   name: 'trees',
    //   parentId: 1003,
    //   id: 10037,
    //   meta: { 'title': '树形', 'show': true },
    //   component: 'other/TreeList',
    //   path: '/other/trees'
    // },
    // {
    //   name: 'users',
    //   parentId: 1003,
    //   id: 10038,
    //   meta: { 'title': '用户', 'show': true },
    //   component: 'other/UserList',
    //   path: '/other/users'
    // },
    // 个人设置
    // {
    //   name: 'account',
    //   parentId: 0,
    //   id: 1004,
    //   meta: {
    //     title: '个人页',
    //     icon: 'user',
    //     show: false,
    //     hideChildren: false
    //   },
    //   redirect: '/account/center',
    //   component: 'RouteView'
    // },
    // {
    //   path: '/account/settings',
    //   name: 'settings',
    //   parentId: 1004,
    //   id: 10041,
    //   component: 'account/settings/Index',
    //   meta: { title: '个人设置', show: true },
    //   redirect: '/account/settings/basic',
    //   hideChildrenInMenu: true
    // },
    // {
    //   path: '/account/settings/basic',
    //   name: 'BasicSettings',
    //   parentId: 10041,
    //   id: 100411,
    //   component: 'account/settings/BasicSetting',
    //   meta: { title: '基本设置', show: true }
    // },
    // {
    //   path: '/account/settings/security',
    //   name: 'SecuritySettings',
    //   parentId: 10041,
    //   id: 100412,
    //   component: 'account/settings/Security',
    //   meta: {
    //     title: '安全设置',
    //     hidden: true
    //   }
    // }
  ]
  const json = builder(nav)
  return json
}

Mock.mock(/\/mock\/user\/info/, 'get', info)
Mock.mock(/\/mock\/user\/nav/, 'get', userNav)
